package com.itheima04;

import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.pool.DruidDataSourceFactory;

import javax.sql.DataSource;
import java.io.InputStream;
import java.sql.Connection;
import java.util.Properties;

/* */
public class DruidTest01 {
    public static void main(String[] args)throws Exception {
        // 通过properties集合加载配置文件
        InputStream is = DruidTest01.class.getClassLoader().getResourceAsStream("druid.properties");
        Properties prop = new Properties();
        prop.load(is);

        // 通过Druid连接工厂类获取数据库连接池对象
        DataSource dataSource = DruidDataSourceFactory.createDataSource(prop);

        // 通过连接池对象获取数据库连接进行使用
        dataSource.getConnection()
    }

}
